export default {
  namespaced: true,
  state: {
    // 标签数据
    tabList: []
  },
  mutations: {
    // 点击导航后给标签数据赋值
    selectMenu(state, value) {
      // 标签数据去重
      let num = state.tabList.findIndex(item => item.label === value.label)
      num === -1 ? state.tabList.push(value) : ''
    },
    // 关闭标签
    closeTab(state, value) {
      let num = state.tabList.findIndex(item => item.label === value.label)
      state.tabList.splice(num, 1)
    }
  },
  actions: {
  }
}